package cn.biplam.common.client;

import java.rmi.RemoteException;

import cn.biplam.common.interfaces.SequenceServer;
import cn.biplam.common.tools.RMITOOLS;
import cn.biplam.common.wrapper.ErrorMessage;

/**
 * 获取序列
 * @author XiaoRuxing 2009-5-15下午09:06:14
 * @version 1.0
 */
public class Sequence {

	/**
	 * 获取表记录在系统的唯一编号
	 * @param userId    用户ID
	 * @return 返回系统唯一递增序号
	 */
	public static String getSequence(String userID){
		String sequenceNum=null;
		try {
			SequenceServer sequenceServer= (SequenceServer)RMITOOLS.getInstance("SequenceServer");
			sequenceNum=sequenceServer.getSequence(userID);
		} catch (RemoteException e) {
			e.printStackTrace();
		} catch (ErrorMessage e) {
			e.printStackTrace();
		}
		return sequenceNum;
	}
	
}
